<?php

/**
 * alltosun.com  test_wb.php
 * ============================================================================
 * 版权所有 (C) 2009-2011 北京互动阳光科技有限公司，并保留所有权利。
 * 网站地址: http://www.alltosun.com
 * ----------------------------------------------------------------------------
 * 许可声明: 这是一个开源程序，未经许可不得将本软件的整体或任何部分用于商业用途及再发布。
 * ============================================================================
 * $Author: 郭莹雪 (guoyx@alltosun.com) $
 * $Date: 2012-3-19 上午11:07:26 $
 * $Id: test_wb.php 11847 2012-11-14 02:40:59Z liw $
*/

class Action
{
    public function __call($action = '', $param = array())
    {
        return;
    }

/*     public function user_info()
    {
        var_dump(AnWeibo::getUserInfo('1862274902'));
    }

    public function session()
    {
        var_dump($_SESSION);
    }

    public function unse()
    {
        $site = Request::Get('site', '');
        unset($_SESSION[$site]);
        var_dump($_SESSION);
    }

    public function update()
    {
        var_dump(AnSinaweibo::update('你是个2', '', '39.90817','116.39794'));
    }

    public function sync_update()
    {
//        $content = Request::Get('content');
        var_dump(sync_connect(998, '好运快快来', array('sinaweibo', 'qqweibo', 'renren', 'kaixin')));
        die();
    }

    public function connect_setting()
    {
        $v2_list = _model('connect_v2')->getList(array('1'=>1));
        foreach ($v2_list as $v) {
            $info = array(
            	'connect_id'=>$v['id'],
                'res_name'=>get_site_name($v['connect_site_id']),
                'user_id' => $v['user_id']
            );
            _model('connect_setting')->create($info);
        }
        $qq_v1 = _model('connect_qq_v1')->getList(array('1'=>1));
        foreach ($qq_v1 as $v) {
             $info = array(
            	'connect_id'=>$v['id'],
                'res_name'=>get_site_name($v['connect_site_id']),
                'user_id' => $v['user_id']
            );
            _model('connect_setting')->create($info);
        }
        $v1_list = _model('connect_v1')->getList(array('1'=>1));
        foreach ($v1_list as $v) {
            $info = array(
                'connect_id'=>$v['id'],
                'res_name'=>get_site_name($v['connect_site_id']),
                'user_id' => $v['user_id']
            );
            _model('connect_setting')->create($info);
        }
        var_dump("ok");
    }

    public function test_emotion()
    {
        $content = '(#滚)[织] [神马] (#怒骂) [浮云] /得意 (mb) /流泪 /害羞 /闭嘴 (th) (sbq) (rs) (#我吐) (#你好讨厌)$000000$';
         preg_match_all('/\([^\#][\S\s]*?\)/', $content, $matches);
         var_dump($matches);
//        foreach (array_unique($matches[0]) as $v) {
//            var_dump($v);
//            $content = preg_replace($v, "", $content);
//        }
        $content = preg_replace('/\([^\#][\S\s]*?\)/', '', $content);
        var_dump($content);
    }

    public function test_pinyin()
    {
        var_dump(Pinyin('啊坏人aaaaa', 1));
    }

    public function insert()
    {
        $public_key = time();
        $secret_key = time();
        $user_id = get_user_id();
        $info = array(
        	'user_id'=>$user_id,
        	'public_key'=>$public_key,
            'secret_key'=>$secret_key
        );
        _model('site')->create($info);
//        var_dump($id);
    }

    public function test_key()
    {
        var_dump(get_secret_key(array('77', 'http://www.baidu.com', 'guoyx@alltosun.com', 'aaaaaaaa')));
    }

    public function display()
    {
        $content = "(#大笑)(#小丑) hahah";
        var_dump(conntent_display($content));
    }

    public function test_category()
    {
        $list = _model('emotion_category')->getList(array('site_id'=>1), 'ORDER BY `id` ASC LIMIT 0,5');
        var_dump($list);
    } */
}
?>